using System;
using System.Xml;

namespace XNASpriteLib
{
	class Orientation
	{
		private readonly String name;

		public Orientation(string name)
		{
			this.name = name;
		}

		public Orientation(XmlNode node)
		{
			if (node == null)
			{
				throw new ArgumentNullException("node", "Animation could not be loaded because the XML node was null");
			}
			else if (node.Attributes == null)
			{
				throw new ArgumentException("Animation could not be loaded because the XML node's Attributes are null");
			}


			if (node.Attributes["name"] != null)
			{
				name = node.Attributes["name"].Value;
			}
			else
			{
				throw new ArgumentException("Animation could not be loaded because the animation does not have a name");
			}
		}

		public String Name
		{
			get { return name; }
		}
	}
}
